//
//  MainViewController.h
//  Gabber
//
//  Created by 惠国 陆 on 11-11-18.
//  Copyright (c) 2011年 恒生聚源. All rights reserved.
//

#import <UIKit/UIKit.h>

@class Message;
@class ChatViewController;
@class RosterTitleView;

@interface MainViewController : TTViewController<NSFetchedResultsControllerDelegate, TTTabDelegate>
{
    NSFetchedResultsController* _unreadController;
    TTTabBar* _tabBar;
    NSMutableDictionary* _tabDict;
    
    XMPPJID* _jid;
    
    ChatViewController* _chatViewController;
    UIToolbar *_toolbar;
    RosterTitleView* _titleView;
    
}

@property (nonatomic, readonly) NSFetchedResultsController* unreadController;


@property (nonatomic, retain) TTTabBar* tabBar;

@property (nonatomic, retain) NSMutableDictionary* tabDict;
@property (nonatomic, retain) XMPPJID* jid;
@property (nonatomic, retain) ChatViewController* chatViewController;
@property (nonatomic, retain) UIToolbar* toolbar;
@property (nonatomic, retain) RosterTitleView* titleView;

- (void)fetchUnreadMessages;
- (void)handleMessageReceived:(NSNotification *)notification;
- (void)handleChatSwitch:(NSNotification *)notification;

//- (void)switchChatTo:(XMPPJID *)jid;

- (void)updateTab:(NSString*) jidStr selected:(BOOL)selected;
- (void)updateBadge;
- (void)closeAction:(id)sender;
- (void)reloadAvatar;

@end
